package html;

import fj.F;
import fj.F2;
import fj.data.List;

public class HTMLFunctions {

	
	public static F2<String,HTMLElem,HTMLElem> wrapElemInHTML = new F2<String,HTMLElem,HTMLElem>()
	{

		@Override
		public HTMLElem f(String tagname, HTMLElem innerHTML) {
			HTMLElem elem = new HTMLElem(tagname);
			return elem.append(innerHTML);
		}

		
	};
	
	public static F<String,F<List<HTMLElem>,HTMLElem>> wrapElemsInHTML = new F<String,F<List<HTMLElem>,HTMLElem>>()
	{

		@Override
		public F<List<HTMLElem>, HTMLElem> f(final String tagname) {
			return new F<List<HTMLElem>,HTMLElem>() {

				@Override
				public HTMLElem f(List<HTMLElem> elems) {
					HTMLElem elem = new HTMLElem(tagname);
					return elem.append(elems);
				}
				
			};
		}

		
	};
	
	public static F2<String,String,HTMLElem> wrapStringInHTML = new F2<String,String,HTMLElem>()
	{

		@Override
		public HTMLElem f(String tagname, String content) {
			HTMLElem elem = new HTMLElem(tagname);
			return elem.append(content);
		}

		
	};

}
